﻿<UserControl x:Class="SellAvi.Views.ControlRegionCombobox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ctrl="clr-namespace:SellAvi.Views"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             mc:Ignorable="d" 
             
             >
    <!--DataContext="{Binding RelativeSource={RelativeSource Self}}"-->
    <!-- ItemsSource="{Binding RegionList,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ctrl:ControlRegionCombobox}}}" -->
    <UniformGrid Columns="2" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ctrl:ControlRegionCombobox}}}">
        <ComboBox x:Name="cbxRegion"  ItemsSource="{Binding RegionList}" DisplayMemberPath="RegionName" SelectedItem="{Binding SelectedRegion}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <i:InvokeCommandAction Command="{Binding FilterCitiesCommand}"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </ComboBox>
        <ComboBox x:Name="cbxCity" ItemsSource="{Binding CityList}" DisplayMemberPath="RegionName" SelectedItem="{Binding SelectedCity}"/> 
    </UniformGrid>
</UserControl>
